package main

import (
	"fmt"
	"os"
)

func main() {
	file, err := os.OpenFile("./2.txt", os.O_WRONLY|os.O_CREATE, 0666)
	if err != nil {
		fmt.Println(err)
	}
	str := "ssss\n"
	slice := []byte(str)
	slice = make([]byte, 5, 10)
	for i := 1; i < 5; i++ {
		slice[i] = 'x'
	}
	n, err1 := file.Write(slice)
	if err1 != nil {
		fmt.Println(err1)
	}
	fmt.Println(n)
}
